$def with (lastrank,allrank)


    <!-- Main jumbotron for a primary marketing message or call to action -->
    <div class="jumbotron">
      <div class="container">
        <h1>Hello, world!</h1>
        <p>This is a template for a simple marketing or informationumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
        <p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more &raquo;</a></p>
      </div>
    </div>

    <div class="container">
      <!-- Example row of columns -->
      <div class="row">
        <div class="col-xs-6 col-md-4">
          <h2>HeadingTest</h2>
   <table class="table">
          <thead>
             <tr>
                 <th>代码</th>
                 <th>名称</th>
                 <th>pj</th>
                 <th>pj时间</th>
             </tr>
          </thead>
          <tbody>
             $for fund in lastrank:
             <tr>
                <td><a href="/dmfund?code=$fund['code']" target="_blank">$fund['code']</a></td>
                <td>$fund['name']</td>
                <td>$fund['rank']</td>
                <td>$fund['date']</td>
             </tr>
          </tbody>
    </table>
 
        </div>
        <div class="col-xs-6 col-md-4">
          <h2>Heading</h2>
          <ul id=chart1>
	         <canvas id="all_ranks_chart" width="600" height="500">
               Your web-browser does not support the HTML 5 canvas element.
             </canvas>
          </ul>
          <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
       </div>
      </div>

      <hr>
<script>			
		var lineChartData = {
			labels : [],
			datasets : [
			        $for i in range(len(allrank)):
			           {
			           fillColor : "rgba($10*i,$15*i,$20*i,0.5)",
			           strokeColor : "rgba(220,0,1,1)",
			           pointColor : "rgba(220,220,220,1)",
			           pointStrokeColor : "#fff",
			           data : []
			           },
			]
			
		}
		$for i in range(len(allrank)):
		    $ rank_list=allrank[i]['rank_list']
		    $for rank in rank_list[::-1]:
		       $if i==0:
		          lineChartData.labels.push("$str(rank[0])")
		       lineChartData.datasets[$i].data.push($rank[1])  

	var myLine = new Chart(document.getElementById("all_ranks_chart").getContext("2d")).Line(lineChartData);
	
	</script>